package com.example.rmiserverdemo.service.impl;

import com.example.rmicommondemo.service.iface.RmiService;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.UnicastRemoteObject;

// ②接口实现
public class MyRmiServiceImpl extends UnicastRemoteObject implements RmiService {


    public MyRmiServiceImpl() throws RemoteException {
    }

    protected MyRmiServiceImpl(int port) throws RemoteException {
        super(port);
    }

    protected MyRmiServiceImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException {
        super(port, csf, ssf);
    }

    @Override
    public String sayHello()  throws RemoteException {
        return "Hello World!";
    }
}
